package com.yida.gwj.vote.outside.domain.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yida.gwj.common.valid.Save;
import com.yida.gwj.common.valid.Submit;
import com.yida.gwj.common.valid.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;

/**
 * @author lqq
 * @date 2023-03-10
 */
@ApiModel("投票项目对象请求")
public class GwjVoteProjectRequest implements Serializable {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty("投票ID")
	@Null(groups = Save.class, message = "请求参数有误[voteId]不能有值")
	@NotNull(groups = {Update.class, Submit.class}, message = "请求参数有误[voteId]为空")
	private Long voteId;

	@ApiModelProperty("投票标题")
	@NotBlank(message = "投票标题不能为空")
	private String voteTitle;

	@ApiModelProperty("小区ID")
	@NotNull(message = "请选择小区")
	private Long communityId;

	@ApiModelProperty("投票发起时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message = "请选择投票发起时间")
	private Date startTime;

	@ApiModelProperty("投票结束时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message = "请选择投票结束时间")
	private Date endTime;

	@ApiModelProperty("对外公示截止日期")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message = "请选择对外公示截止日期")
	private Date publicEndTime;

	@ApiModelProperty("投票说明内容")
	@NotBlank(message = "投票投票说明内容")
	private String voteContent;

	@ApiModelProperty("投票类别")
	@NotBlank(message = "请选择投票类别")
	private String voteType;

	@ApiModelProperty("地区ID")
	@NotNull(message = "请求数据有误[地区ID]为空")
	private Long areaId;

	@ApiModelProperty("街道ID")
	@NotNull(message = "请求数据有误[街道ID]为空")
	private Long streetId;

	@ApiModelProperty("投票最少需选择项")
	@NotNull(message = "请输入投票最少需选择项")
	private Integer minSelectItem;

	@ApiModelProperty("投票最多需选择项")
	@NotNull(message = "请输入投票最多需选择项")
	private Integer maxSelectItem;

	@ApiModelProperty("已选楼栋数组")
	@NotEmpty(groups = Save.class, message = "请选择楼栋")
	private Long[] buildIds;

	public Long[] getBuildIds() {
		return buildIds;
	}

	public void setBuildIds(Long[] buildIds) {
		this.buildIds = buildIds;
	}

	public Long getVoteId() {
		return voteId;
	}

	public void setVoteId(Long voteId) {
		this.voteId = voteId;
	}

	public String getVoteTitle() {
		return voteTitle;
	}

	public void setVoteTitle(String voteTitle) {
		this.voteTitle = voteTitle;
	}

	public Long getCommunityId() {
		return communityId;
	}

	public void setCommunityId(Long communityId) {
		this.communityId = communityId;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Date getPublicEndTime() {
		return publicEndTime;
	}

	public void setPublicEndTime(Date publicEndTime) {
		this.publicEndTime = publicEndTime;
	}

	public String getVoteContent() {
		return voteContent;
	}

	public void setVoteContent(String voteContent) {
		this.voteContent = voteContent;
	}

	public String getVoteType() {
		return voteType;
	}

	public void setVoteType(String voteType) {
		this.voteType = voteType;
	}

	public Long getAreaId() {
		return areaId;
	}

	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}

	public Long getStreetId() {
		return streetId;
	}

	public void setStreetId(Long streetId) {
		this.streetId = streetId;
	}

	public Integer getMinSelectItem() {
		return minSelectItem;
	}

	public void setMinSelectItem(Integer minSelectItem) {
		this.minSelectItem = minSelectItem;
	}

	public Integer getMaxSelectItem() {
		return maxSelectItem;
	}

	public void setMaxSelectItem(Integer maxSelectItem) {
		this.maxSelectItem = maxSelectItem;
	}

	@Override
	public String toString() {
		final StringBuffer sb = new StringBuffer("VoteProjectRequest{");
		sb.append("voteId=").append(voteId);
		sb.append(", voteTitle='").append(voteTitle).append('\'');
		sb.append(", communityId=").append(communityId);
		sb.append(", startTime=").append(startTime);
		sb.append(", endTime=").append(endTime);
		sb.append(", publicEndTime=").append(publicEndTime);
		sb.append(", voteContent='").append(voteContent).append('\'');
		sb.append(", voteType='").append(voteType).append('\'');
		sb.append(", areaId=").append(areaId);
		sb.append(", streetId=").append(streetId);
		sb.append(", minSelectItem=").append(minSelectItem);
		sb.append(", maxSelectItem=").append(maxSelectItem);
		sb.append(", buildIds=").append(buildIds == null ? "null" : Arrays.asList(buildIds).toString());
		sb.append('}');
		return sb.toString();
	}
}
